package com.study.util;

import java.util.List;

public class PageHelper<T> {
    public int total;
    public int curPage=1;
    public int pageSize=5;
    public String orderBy="id";
    public List<T> list;

    public String getOrderBy() {
        return orderBy;
    }

    public void setOrderBy(String orderBy) {
        this.orderBy = orderBy;
    }

    public int getTotal() {
        return total;
    }

    public void setTotal(int total) {
        this.total = total;
    }

    public int getCurPage() {
        return curPage==0?1:curPage;
    }

    public void setCurPage(int curPage) {
        this.curPage = curPage;
    }

    public int getPageSize() {
        return pageSize==0?1:pageSize;
    }

    public void setPageSize(int pageSize) {
        this.pageSize = pageSize;
    }

    public List<T> getList() {
        return list;
    }

    public void setList(List<T> list) {
        this.list = list;
    }

    @Override
    public String toString() {
        return "PageHelper{" +
                "total=" + total +
                ", curPage=" + curPage +
                ", pageSize=" + pageSize +
                ", list=" + list +
                '}';
    }
}
